using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Mgh.UI.Sql;

public partial class Admin : MasterBase
{
    override protected void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);
        //if (!CurrentUser.checkAdmin())
        //{
        //    Response.Redirect("ALogin.aspx?url=" + HttpUtility.UrlEncode(Request.Url.PathAndQuery));
        //}
        this.includeScript();
        this.includeStyleSheet();
        if (!IsPostBack)
        {
            lbl1.Text = CurrentUser.Username;
        }
    }

    protected void lbt_Click(object sender, EventArgs e)
    {
        CurrentUser.logOut();
        Response.Redirect("ALogin.aspx?url=" + HttpUtility.UrlEncode(Request.Url.PathAndQuery));
    }

    protected void includeScript()
    {
        Page.ClientScript.RegisterClientScriptInclude("jquery", this.ResolveClientUrl("~/Scripts/jquery-1.7.1.min.js"));
        Page.ClientScript.RegisterClientScriptInclude("jcore", this.ResolveClientUrl("~/Scripts/jquery-ui.min.js"));
        Page.ClientScript.RegisterClientScriptInclude("jwidget", this.ResolveClientUrl("~/Scripts/jquery.ui.widget.js"));
        Page.ClientScript.RegisterClientScriptInclude("jmodal", this.ResolveClientUrl("~/Scripts/jquery.simplemodal.js"));
        Page.ClientScript.RegisterClientScriptInclude("jmodalgallary", this.ResolveClientUrl("~/Scripts/jquery.simplemodal.gallery.js"));
        Page.ClientScript.RegisterClientScriptInclude("common", this.ResolveClientUrl("~/Scripts/Common.js"));
    }

    protected void includeStyleSheet()
    {
        Literal lt1 = new Literal();
        lt1.Text = "<link href=\"/App_Themes/Admin/basic.css\" rel=\"Stylesheet\" type=\"text/css\" rel='stylesheet' media='screen'/><br/>";
        lt1.Text = "<link href=\"/App_Themes/Admin/jquery.simplemodal.gallery.css\" rel=\"Stylesheet\" type=\"text/css\" />";
        Page.Header.Controls.Add(lt1);
    }
}
